package com.xywang.dao.user;

import com.xywang.pojo.Role;
import com.xywang.pojo.User;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public interface UserDao {
    // 得到要登录的用户
    public User getLoginUser(Connection connection, String userCode) throws SQLException;
    // 修改用户密码
    public int updatePwd(Connection connection,int id , String password)throws SQLException;
    // 根据用户名或者角色查询用户总数
    public int getUserCount(Connection connection,String username,int userrole)throws SQLException;
    //  通过条件返回用户列表
    public List<User> getUserList(Connection connection, String userName, int userRole, int currentPageNo, int pageSize) throws Exception;
    // 添加用户
    public int addUserDao(Connection connection,User user)throws SQLException;
    // 删除用户
    public int deleteUser(Connection connection,int id)throws SQLException;
    // 通过id得到用户
    public User getUserById(Connection connection,int id)throws SQLException;
    // 用户更新
    public int updateUser(Connection connection,User user)throws SQLException;
}
